{extend name="public/base" /} 
{block name="css"}
<link rel="stylesheet" href="__INDEX__/css/create-index.css">
<link rel="stylesheet" href="__INDEX__/css/plugins/sweetalert/sweetalert.css">
 <link href="__PLUGIN__/Fileinput/css/fileinput.css" rel="stylesheet">
{/block}
{block name="container"}
<div>
    <form action="" method="post">
        <div class="panel-body panel-body-nopadding" id="print">
            <div class="inforMain">客户信息</div>
            <div class="form-groups">
                <label class="col-sm-1 control-label">
                    <span>*</span>客户名称：</label>
                    <div class="col-sm-6">
                        {$data['customer']['name'] ?? ''}
                    </div>
                </div>
                <div class="form-groups">
                    <label class="col-sm-1 control-label">
                        <span>*</span>联系电话：</label>
                        <div class="col-sm-6">
                            {$data['customer']['phone'] ?? ''}
                        </div>
                    </div>
                    <div class="form-groups">
                        <label class="col-sm-1 control-label">
                            <span>*</span>性&emsp;&emsp;别：</label>
                            <div class="col-sm-6">
                                {$data['customer']['sex'] ?? ''}
                            </div>
                        </div>
                        <div class="form-groups">
                            <label class="col-sm-1 control-label">
                                <span>*</span>年&emsp;&emsp;龄：</label>
                                <div class="col-sm-6">
                                    {$data['customer']['age'] ?? ''}
                                </div>
                            </div>
                            <div class="form-groups" style="padding-bottom: 10px">
                                <label class="col-sm-1 control-label">
                                    <span>*</span>收货地址：</label>
                                    <div class="col-sm-6">
                                        {$data['customer']['dizhi'] ?? ''}
                                    </div>
                                </div>
                                <div class="form-groups" style="padding-bottom: 10px">
                                    <label class="col-sm-1 control-label">
                                        <span>*</span>驳回理由：</label>
                                        <div class="col-sm-6" style="color: red;">
                                            {$data['reson'] ?? '没有理由'}
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-12 control-label" style="background: #7F7F7F;text-align: center;color: #000;">量体信息</label>
                                        <div>
                                            <table class="table ">
                                                <tr>
                                                    <th class="col-sm-1" style="text-align:center;box-sizing:border-box;border-right:1px solid #000000;border-bottom: 1px solid #000;border-left: 1px solid #000;">部位</th>
                                                    <th class="col-sm-1" style="text-align:center;box-sizing:border-box;border-right:1px solid #000000;border-bottom: 1px solid #000; ">净尺寸</th>
                                                    <th class="col-sm-1" style="text-align:center;box-sizing:border-box;border-right:1px solid #000000;border-bottom: 1px solid #000; ">成品尺寸</th>
                                                    <th class="col-sm-1" style="text-align:center;box-sizing:border-box;border-right:1px solid #000000;border-bottom: 1px solid #000; ">部位</th>
                                                    <th class="col-sm-1" style="text-align:center;box-sizing:border-box;border-right:1px solid #000000;border-bottom: 1px solid #000; ">净尺寸</th>
                                                    <th class="col-sm-1" style="text-align:center;box-sizing:border-box;border-right:1px solid #000000;border-bottom: 1px solid #000; ">成品尺寸</th>
                                                    <th class="col-sm-1" style="text-align:center;box-sizing:border-box;border-right:1px solid #000000;border-bottom: 1px solid #000; ">部位</th>
                                                    <th class="col-sm-1" style="text-align:center;box-sizing:border-box;border-right:1px solid #000000;border-bottom: 1px solid #000; ">净尺寸</th>
                                                    <th class="col-sm-1" style="text-align:center;box-sizing:border-box;border-right:1px solid #000000;border-bottom: 1px solid #000; ">成品尺寸</th>
                                                </tr>
                                                <tr>
                                                    <td>1.身高</td>
                                                    <td>
                                                        <input type="text" name="jing[height]" class="form-control1" value="{$data['first']['height'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[height]">
                                                    </td>
                                                    <td>16.右袖长</td>
                                                    <td>
                                                        <input type="text" name="jing[right_sleeve]" class="form-control1" value="{$data['first']['right_sleeve'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[right_sleeve]">
                                                    </td>
                                                    <td colspan="3">肩型</td>
                                                </tr>
                                                <tr>
                                                    <td>2.体重</td>
                                                    <td>
                                                        <input type="text" name="jing[weight]" style="width: 26%" value="{$data['first']['weight'] ?? ''}">kg
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[weight]" >
                                                    </td>
                                                    <td>17.后腰节</td>
                                                    <td>
                                                        <input type="text" name="jing[b_lumbar]" class="form-control1" value="{$data['first']['b_lumbar'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[b_lumbar]">
                                                    </td>
                                                    <td colspan="3">
                                                        左：
                                                        <input type="text" style="display: inline-block;width: 25px" name="jing[st_left]" value="{$data['first']['st_left'] ?? ''}"
                                                        > 右：
                                                        <input type="text" style="display: inline-block;width: 25px" name="jing[st_right]" value="{$data['first']['st_right'] ?? ''}"
                                                        >
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>3.领围</td>
                                                    <td>
                                                        <input type="text" name="jing[neck]" class="form-control1" value="{$data['first']['neck'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[neck]">
                                                    </td>
                                                    <td>18.后衣长</td>
                                                    <td>
                                                        <input type="text" name="jing[b_coat]" class="form-control1" value="{$data['first']['b_coat'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[b_coat]">
                                                    </td>
                                                    <td colspan="3">肚型</td>
                                                </tr>
                                                <tr>
                                                    <td>4.胸围</td>
                                                    <td>
                                                        <input type="text" name="jing[bust]" class="form-control1" value="{$data['first']['bust'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[bust]">
                                                    </td>
                                                    <td>19.后腰高</td>
                                                    <td>
                                                        <input type="text" name="jing[bl_height]" class="form-control1" value="{$data['first']['bl_height'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[bl_height]">
                                                    </td>
                                                    <td colspan="3">
                                                        <input type="radio" name="jing[belly]" value="1" {if condition="$data['first']['belly'] eq 1" } checked="checked" {/if} style="width: auto;"
                                                        disabled>正常
                                                        <input type="radio" name="jing[belly]" value="2" {if condition="$data['first']['belly'] eq 2" } checked="checked" {/if} style="width: auto;"
                                                        disabled>凸肚
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>5.中腰围</td>
                                                    <td>
                                                        <input type="text" name="jing[middle_waist]" class="form-control1" value="{$data['first']['middle_waist']}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[middle_waist]">
                                                    </td>
                                                    <td>20.前腰节</td>
                                                    <td>
                                                        <input type="text" name="jing[a_lumbar]" class="form-control1" value="{$data['first']['a_lumbar'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[a_lumbar]">
                                                    </td>
                                                    <td colspan="3">臂型</td>
                                                </tr>
                                                <tr>
                                                    <td>6.裤腰围</td>
                                                    <td>
                                                        <input type="text" name="jing[pants_waist]" class="form-control1" value="{$data['first']['pants_waist'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[pants_waist]">
                                                    </td>
                                                    <td>21.前腰高</td>
                                                    <td>
                                                        <input type="text" name="jing[al_height]" class="form-control1" value="{$data['first']['al_height'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[al_height]">
                                                    </td>
                                                    <td colspan="3">
                                                        <input type="radio" name="jing[arm]" value="1" {if condition="$data['first']['arm'] eq 1" } checked="checked" {/if}style="width: auto;"
                                                        disabled>正常
                                                        <input type="radio" name="jing[arm]" value="2" {if condition="$data['first']['arm'] eq 2" } checked="checked" {/if} style="width: auto;"
                                                        disabled>手臂靠后
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>7.臀围</td>
                                                    <td>
                                                        <input type="text" name="jing[hipline]" class="form-control1" value="{$data['first']['hipline'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[hipline]">
                                                    </td>
                                                    <td>22.裤长</td>
                                                    <td>
                                                        <input type="text" name="jing[trousers]" class="form-control1" value="{$data['first']['trousers'] ?? ''}"  
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[trousers]">
                                                    </td>
                                                    <td colspan="3">臀型</td>
                                                </tr>
                                                <tr>
                                                    <td>8.腿根围</td>
                                                    <td>
                                                        <input type="text" name="jing[leg_size]" class="form-control1" value="{$data['first']['leg_size'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[leg_size]">
                                                    </td>
                                                    <td>23.腰膝长</td>
                                                    <td>
                                                        <input type="text" name="jing[wk_length]" class="form-control1" value="{$data['first']['wk_length'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[wk_length]">
                                                    </td>
                                                    <td colspan="3">
                                                        <input type="radio" name="jing[buttocks]" value="1" {if condition="$data['first']['buttocks'] eq 1" } checked="checked" {/if}
                                                        style="width: auto;" disabled>正常
                                                        <input type="radio" name="jing[buttocks]" value="2" {if condition="$data['first']['buttocks'] eq 2" } checked="checked" {/if}
                                                        style="width: auto;" disabled>翘臀
                                                        <input type="radio" name="jing[buttocks]" value="3" {if condition="$data['first']['buttocks'] eq 3" } checked="checked" {/if}
                                                        style="width: auto;" disabled>坠臀
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>9.通档</td>
                                                    <td>
                                                        <input type="text" name="jing[tongdang]" class="form-control1" value="{$data['first']['tongdang'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[tongdang]">
                                                    </td>
                                                    <td>24.膝围</td>
                                                    <td>
                                                        <input type="text" name="jing[knee]" class="form-control1" value="{$data['first']['knee'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[knee]">
                                                    </td>
                                                    <td colspan="3"></td>
                                                </tr>
                                                <tr>
                                                    <td>10.上臂围</td>
                                                    <td>
                                                        <input type="text" name="jing[upper_arm]" class="form-control1" value="{$data['first']['upper_arm'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[upper_arm]">
                                                    </td>
                                                    <td>25.腿肚围</td>
                                                    <td>
                                                        <input type="text" name="jing[calf_length]" class="form-control1" value="{$data['first']['calf_length'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[calf_length]">
                                                    </td>
                                                    <td colspan="3"></td>
                                                </tr>
                                                <tr>
                                                    <td>11.左腕围</td>
                                                    <td>
                                                        <input type="text" name="jing[left_wrist]" class="form-control1" value="{$data['first']['left_wrist'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[left_wrist]">
                                                    </td>
                                                    <td>26.脚口</td>
                                                    <td>
                                                        <input type="text" name="jing[foot]" class="form-control1" value="{$data['first']['foot'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[foot]">
                                                    </td>
                                                    <td colspan="3"></td>
                                                </tr>
                                                <tr>
                                                    <td>12.右腕围</td>
                                                    <td>
                                                        <input type="text" name="jing[right_wrist]" class="form-control1" value="{$data['first']['right_wrist'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[right_wrist]">
                                                    </td>
                                                    <td>27.胸高</td>
                                                    <td>
                                                        <input type="text" name="jing[th_height]" class="form-control1" value="{$data['first']['th_height'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[th_height]">
                                                    </td>
                                                    <td colspan="3"></td>
                                                </tr <tr>
                                                    <td>13.总肩宽</td>
                                                    <td>
                                                        <input type="text" name="jing[shoulder]" class="form-control1" value="{$data['first']['shoulder'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[shoulder]">
                                                    </td>
                                                    <td>28.胸距</td>
                                                    <td>
                                                        <input type="text" name="jing[th_distance]" class="form-control1" value="{$data['first']['th_distance'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[th_distance]">
                                                    </td>
                                                    <td colspan="3"></td>
                                                </tr>
                                                <tr>
                                                    <td>14.前肩宽</td>
                                                    <td>
                                                        <input type="text" name="jing[front_shoulder]" class="form-control1" value="{$data['first']['front_shoulder'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[front_shoulder]">
                                                    </td>
                                                    <td>29.前胸宽</td>
                                                    <td>
                                                        <input type="text" name="jing[across_front]" class="form-control1" value="{$data['first']['across_front'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[across_front]">
                                                    </td>
                                                    <td colspan="3"></td>
                                                </tr>
                                                <tr>
                                                    <td>15.左袖长</td>
                                                    <td>
                                                        <input type="text" name="jing[left_sleeve]" class="form-control1" value="{$data['first']['left_sleeve'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[left_sleeve]">
                                                    </td>
                                                    <td>30.后背宽</td>
                                                    <td>
                                                        <input type="text" name="jing[across_back]" class="form-control1" value="{$data['first']['across_back'] ?? ''}"  >
                                                    </td>
                                                    <td>
                                                        <input type="text" name="cheng[across_back]">
                                                    </td>
                                                    <td colspan="3"></td>
                                                </tr>
                                            </table>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-12 control-label" style="background: #7F7F7F;text-align: center;color: #000;">订单信息
                                            <div style="display: inline-block;background: #7F7F7F;padding-left:200px;font-size: 12px">产品编号:
                                                <input type="text" style="background: #7F7F7F;border:0" name="order[pro_num]"   value="{$data['pro_num'] ?? ''}">
                                            </div>
                                        </label>
                                        <div class="col-sm-12">
                                            <table class="table ">
                                                <tr>
                                                    <td>品类</td>
                                                    <td colspan="8">
                                                        {volist name="category" id="vo"}
                                                        <input type="radio" value="{$vo.id}" {if condition="$data['category_id'] eq $vo['id']" } checked="checked" {/if} 
                                                        name="order[category_id]" style="width: auto;"  >{$vo.title} {/volist}
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>款式编号</td>
                                                    <td colspan="2">
                                                        <input type="text" name="order[style_num]"  style="width: 100%"  value="{$data['style_num'] ?? ''}">
                                                    </td>
                                                    <td>面料编号</td>
                                                    <td colspan="2">
                                                        <input type="text" name="order[ml_num]"  style="width: 100%" value="{$data['ml_num'] ?? ''}">
                                                    </td>
                                                    <td>订单属性</td>
                                                   <td colspan="2" style="display: flex;justify-content: center;">
                                                     <input type="radio" value="2" name="order[shuxing]" {if condition="$data['shuxing'] eq 2"} checked {/if}  style="width: auto;"><p style="color: #676a6c !important;">售后订单</p>
                                                     <input type="radio" value="1" name="order[shuxing]" {if condition="$data['shuxing'] eq 1"} checked {/if}  style="width: auto;margin-left: 10px;"><p style="color: #676a6c !important;">正常订单</p>
                                                   </td>
                                                </tr>
                                                <tr>
                                                    <td>款式细节</td>
                                                    <td colspan="8">
                                                        <textarea name="order[detail]" id=""  cols="30" rows="10" style="border:0px;width: 100%;outline: none;">{$data['detail'] ?? ''}</textarea>
                                                    </td>
                                                </tr>
                                                        <tr>
            <td>着装风格</td>
            <td colspan="8">
                {volist name="style" id="vo"}
                <input type="radio" style="display: inline-block;width: auto;" name="order[yifu_style]" value="{$vo.id}" {if condition="$vo['id'] eq $data['yifu_style']"} checked {/if}>{$vo.name}
                {/volist}
            </td>
        </tr>
                                                <tr>
                                                    <td>特殊备注</td>
                                                    <td colspan="4">
                                                        <input type="text" style="width: 100%;" name="order[comment]"   value="{$data['comment'] ?? '暂无'}">
                                                    </td>
                                                    <td>加急</td>
                                                    <td colspan="3">
                                                        <input type="radio" style="display: inline-block;width: auto;" {if condition="$data['is_urgent'] eq 1" } checked="checked"
                                                        {/if} disabled name="order[is_urgent]" value="1">是
                                                        <input type="radio" style="display: inline-block;width: auto;" name="order[is_urgent]" {if condition="$data['is_urgent'] eq 0"
                                                    } checked="checked" {/if} disabled value="0">否
                                                    <div style="display: inline-block;">加急
                                                        <input type="text" style="width: 25px;" name="order[urgent_num]"   value="{$data['urgent_num'] ?? ''}">天</div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                   <td >订单金额</td>
                                                   <td colspan="1" ><input type="text" name="order[price]" value="{$data['price'] ?? ''}" required></td>
                                                   <td >实付金额</td>
                                                   <td colspan="1"><input type="text" name="order[true_price]" value="{$data['true_price'] ?? ''}" required></td>
                                                   <td>是否代加工</td>
                                                   <td colspan="4" style="padding: 0px;">
                                                     <input type="radio" class="is_ok" style="display: inline-block;width: auto;padding: 8px 0" name="order[is_dai]" {if condition="$data['is_dai'] eq 1"} checked="cheked" {/if} disabled value="1">是
                                                       <input type="radio" class="is_ok" style="display: inline-block;width: auto;padding: 8px 0" name="order[is_dai]" {if condition="$data['is_dai'] eq 0"} checked="cheked" {/if} disabled value="0">否
                                                       <div style="display: none;float: right;width: 50%;"id="gongchang">选择工厂<select name="order[gongchang]" id="" style="width: 65%;outline: none;margin-left: 10px;border: 0px; ">
                                                          <option value="-1">请选择工厂</option>
                                    <option value="1">红岭</option>
                                    <option value="2">如意</option>
                                    <option value="3">鲁泰</option>
                                                       </select></div>
                                                   </td>
                                               </tr>
                                                <tr>
            <td colspan="1">付款方式</td>
            <td colspan="8">
                    <input class="is_dian" type="radio" name="payment" value="1" style="display: inline-block;width: auto;padding: 1px"{if condition="$data['payment'] eq 1"} checked="checked"{/if} disabled>
                    普通支付
                    <input class="is_dian" type="radio" name="payment" value="0" style="display: inline-block;width: auto;padding: 1px"{if condition="$data['payment'] eq 0"} checked="checked"{/if} disabled>会员卡支付
                <div style="display: inline-block;">

                    <span id="huiyuan" style="display: none;margin-left: 30px;">
                        卡号：<input type="text" name="card_num" id="card_num" style="display: inline-block;width: auto;padding:1px " value="{$data['card_num'] ?? ''}" disabled>
                    </span>
                </div>
            </td>
        </tr>
                                                <tr></tr>
                                            </table>
                                        </div>
                                    </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">付款凭证：</label>
                                    <div class="col-sm-7">
                                        <input id="fileone" type="file" class="file-loading">
                                        <input type="hidden" id="picurl" placeholder="缩略图" name="order[picurl]" value="{$data['picurl'] ?? ''}">
                                    </div>
                                </div>
                                <div class="form-group">
    <label class="col-sm-3 control-label">客户组图：</label>
    <div class="col-sm-7">
       <input id="filepic" type="file" multiple >
       {volist name="$data['picarr']" id="vop"}
           <input type="hidden" value="{$vop.img}" name="picimg[]" flag="{$vop.info}" show="{$vop.show}">
       {/volist}
   </div>
</div>
                                </div>

                                <div class="panel-footer">
                                    <div class="row">
                                        <div class="col-sm-6 col-sm-offset-3">
                                            <input type="hidden" name="id" value="{$data['id'] ?? ''}">
                                            <input type="hidden" name="jing[id]" value="{$data['first']['id'] ?? ''}">
                                            <button type="submit" class="btn btn-primary" style="margin:0 20px">提交</button>
                                            <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);" style="margin:0 20px;">返回</button>
                                        </div>
                                    </div>
                                </div>

                                <!-- panel-footer -->
                            </form>
                        </div>
   {/block} 
   {block name="js"}
    <script src="__PLUGIN__/Fileinput/js/fileinput.js"></script>
<script>
   $(document).ready(function() {
    fileinputOne("fileone","picurl");
    fileinputMore('filepic','picimg[]','picarr[]');
    $("[name='order[gongchang]']").find("[value='{$data.gongchang ?? '-1'}']").attr("selected", true);
    if($('.is_ok:checked').val() == 1){
        $('#gongchang').css('display','block');
    }else{
        $('#gongchang').css('display','none');
    }
    if($('.is_dian:checked').val() == 0){
        $('#huiyuan').css('display','block');
    }else{
        $('#huiyuan').css('display','none');
    }
   });
   
</script>
<script>
    function fileinputOne(fileid,field){
      var widths = arguments[2] ? arguments[2] : 'auto';//设置默认的图片宽度
      var heights = arguments[3] ? arguments[3] : '160px';//设置默认的图片高度
      //单图上传
      var $input = $("#"+fileid);
      var $picurl = $("#"+field); 
        
      var $Preview =[];
      var $Config =[];
      if($picurl.val()!=''){
         $Preview =["<img class='kv-preview-data file-preview-image' style='width:"+widths+";height:"+heights+";' src='"+$picurl.val()+"'>"];
         $Config =[{key: 1}];
      }
      $input.fileinput({
          uploadUrl: "{:url('index/common/upload')}",
          deleteUrl: "{:url('index/common/updel')}",
          autoReplace: true,
          overwriteInitial: true,
          showUploadedThumbs: false,
          maxFileCount: 1,
          initialPreview: $Preview,
          initialPreviewConfig: $Config,
          layoutTemplates: {actionDelete: ''}, 
      }).on("filebatchselected", function(event, files) {
          $input.fileinput("upload");//选择后自动上传
      }).on('fileuploaded', function(event, data,previewId,index) {
           //alert(JSON.stringify(data));
           var dataObj=eval("("+data.response+")");
           if(dataObj['code']==0)
             {  
                 $picurl.val(dataObj['img']);
             }
           else{
                swal("出错了", "上传失败,请刷新再试", "error");
             }
      }).on("filecleared", function(event, files) {
             $picurl.val('');
      });

}
//组图上传
function fileinputMore(fileid,picurlname,field){
      var widths = arguments[3] ? arguments[3] : 'auto';//设置默认的图片宽度
      var heights = arguments[4] ? arguments[4] : '160px';//设置默认的图片高度
      //组图上传
      var $input = $("#"+fileid);
      var $picimg = $("input[name='"+picurlname+"']");

      var $Preview =[];
      var $Config =[];
      $picimg.each(function(i,e){
       $Preview.push("<img class='kv-preview-data file-preview-image' style='width:"+widths+";height:"+heights+";' src='"+$(this).val()+"'>");
       $Config.push({caption: $(this).attr('flag'),show: $(this).attr('show'),size:0,url:"<input type='hidden' name='"+field+"' value='"+$(this).val()+"'>", key: i});

   });

      var footerTemplate = '<div class="file-thumbnail-footer">\n' +
      '   <div style="margin:5px 0">\n' +
      '       <input type="text" class="hidden" value="{show}" name="show[]"><input class="kv-input kv-new form-control input-sm text-center" value="{caption}" placeholder="填写注释" name="info[]">\n' +
      '   </div>\n' +
      '   <button type="button" class="kv-file-forward text-info header-left" title="前移"><i class="glyphicon glyphicon-chevron-left"></i></button>\n' +
      '   &nbsp;{size}&nbsp;\n' +
      '   <button type="button" class="kv-file-backward text-danger header-right" title="后移"><i class="glyphicon glyphicon-chevron-right"></i></button>\n' +
      '   <button type="button" class="kv-file-heart text-danger header-left" title="显示隐藏"><i class="glyphicon glyphicon-heart{show}"></i></button>\n' +
      '   {actions}\n' +
      '</div>';

      $input.fileinput({
          uploadUrl: "{:url('index/common/upload')}",
          deleteUrl: "{:url('index/common/updel')}",
          autoReplace: false,
          overwriteInitial: false,
          layoutTemplates: {footer: footerTemplate, size: '<samp><small>({sizeText})</small></samp>'},
          initialPreview: $Preview,
          initialPreviewConfig: $Config,
      }).on("filebatchselected", function(event, files) {
          $input.fileinput("upload");//选择后自动上传
      }).on('fileuploaded', function(event, data,previewId,index) {
            var dataObj=eval("("+data.response+")");
             if(dataObj['code']==0)
                 { 
           $('#'+previewId).append("<input type='hidden' name='"+field+"' value='"+dataObj['img']+"'>");
              }
              else{
        swal("出错了", "上传失败,请刷新再试", "error");
           }
});
  }
</script>
<script>
  
   $(function () {
      $(".is_ok").click(function () {
          if ($(this).val() == 1) {
              //alert("选中了");
              $('#gongchang').css('display','block');
          }else{
            $('#gongchang').css('display','none');
          }
      });

           // 支付方式
      $(".is_dian").click(function(){
          if($(this).val() == 1){
              $('#huiyuan').css('display','none')
          }else{
              $('#huiyuan').css('display','block')
          }
          
      })
  });
</script>
   {/block}
